<?php
namespace app\home\controller;
use \think\Controller;
use app\home\model\ImagesModel;
use app\home\controller\Special;
use app\home\controller\Knows;
use app\home\controller\Images;
use app\home\controller\Operation;
class Index extends Controller
{
    /**
     * 首页
     */
    public function index()
    {
        /**/
        /*首页特卖信息*/
        $specials = new Special();
        $specials= $specials->index();
        $this->assign('specials',$specials);
        /**/

        /*首页最新育儿资讯信息*/
        $knows = new Knows();
        $knows= $knows->index();
        $this->assign('knows',$knows);

        /**
         *首页轮播信息
         */
        $imgs = new Images();
        $imgs =$imgs->index();
        $this->assign('imgs',$imgs);


        //首页导航图标
        $msg = new Operation();
        $msg = $msg->index();
        $this->assign('msg',$msg);

        //首页专题内容
        $knowsSpecial =new Knows();
        $knowsSpecial =$knowsSpecial->getKspecial();
        foreach($knowsSpecial as $key => $id){
            $count = new Knows();
            $count = $count->getCount($id['id']);
            $knowsSpecial[$key]['count'] =  $count;
        }
        $this->assign('knowsSpecial',$knowsSpecial);
        return $this->fetch('index');
    }

}
